#ifndef __MYSQLFUNC_H__
#define __MYSQLFUNC_H__
#include "Utils.h"

//输入的sql语句类型
typedef enum{
    rd_sql,
    wr_sql
}sql_type;

//user_table
//uid, user_name, salt, encrypted_pwd
//virtual_file_system_table
//file_id, file_name, user_name, parent_id, path, type, md5, tomb
//log_table
//log_line, priority, msg, time, func

int SqlConnectionInit(MYSQL **mysql_connect);
int SqlConnectionClosed(MYSQL **mysql_connect);
int SqlHandler(MYSQL *mysql_connect, char *query, sql_type type, char *result);
int SqlGetPath(MYSQL *mysql_connect, const char *path, int pwd_file_id, char *result_path);

int SqlAddLog(MYSQL *mysql_connect, char *priority, char *msg, char *func);
#endif  //__MYSQLFUNC_H__